/*
 * Copyright (c) 2023, LXMS (lxinet.cn).
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package cn.lxinet.lxms.system.message;

import cn.lxinet.lxms.framework.core.message.ErrorCode;

/**
 * 提示语
 * 0表示成功
 * 1 000 0001
 * 第1位，1表示系统错误 2表示业务错误
 * 第2-3位，表示系统，001 system
 * 第4-7位，具体提示code
 *
 * @author zcx
 * @date 2023/07/09
 */
public enum SystemErrorCode implements ErrorCode {

    TOKEN_CANNOT_EMPTY(20010001, "token不能为空"),
    TOKEN_EXPIRED(20010002, "token已失效"),
    NAME_OR_PASSWORD_INCORRECT(20010003, "用户名或者密码错误"),
    ACCOUNT_IS_DISABLED(20010004, "账号已被禁用"),
    PARENT_DEPT_NOT_EXIST(20010005, "上级部门不存在"),
    DEPT_NOT_EXIST(20010006, "部门不存在"),
    CODE_EXIST(20010007, "编号已存在"),
    USER_ACCOUNT_EXIST(20010008, "账号已存在"),
    USER_PHONE_EXIST(20010009, "手机号已存在"),
    USER_EMAIL_EXIST(20010010, "邮箱已存在"),
    USER_NOT_EXIST(20010011, "用户不存在"),
    DICT_TYPE_NOT_EXIST(20010012, "字典类型不存在"),
    SYS_DICT_TYPE_CANNOT_DELETE(20010013, "系统内置的字典类型无法删除"),
    ROLE_NOT_EXIST(20010014, "角色不存在"),
    ROLE_ADMINISTRATOR_CAN_NOT_UPDATE(20010015, "超级管理员角色不能修改"),
    ROLE_ADMINISTRATOR_CAN_NOT_DEL(20010016, "超级管理员角色不能删除"),

    ;

    private Integer code;
    private String msg;

    SystemErrorCode(Integer code, String msg){
        this.code = code;
        this.msg = msg;
    }

    public Integer getCode(){
        return code;
    }

    public String getMsg(){
        return msg;
    }
}
